package com.imddysc.springbootmultidatasources.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.imddysc.springbootmultidatasources.entity.Student;
import com.imddysc.springbootmultidatasources.repository.StudentRepository;

@Controller
@RequestMapping("/t1")
public class T1Controller {
	
	@Autowired
	private StudentRepository studentRepository;

	@ResponseBody
	@RequestMapping("/getAll")
	public List<Student> getAll() {
		return studentRepository.findAll();
	}
}
